//地图
(function () {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init($(".map")[0]);

    window.dataList = [{
        name: "南海诸岛",
        value: 0
    },
        {
            name: '北京',
            value: 0
        },
        {
            name: '天津',
            value: 0
        },
        {
            name: '上海',
            value: 0
        },
        {
            name: '重庆',
            value: 0
        },
        {
            name: '河北',
            value: 0
        },
        {
            name: '河南',
            value: 0
        },
        {
            name: '云南',
            value: 683410
        },
        {
            name: '辽宁',
            value: 0
        },
        {
            name: '黑龙江',
            value: 0
        },
        {
            name: '湖南',
            value: 0
        },
        {
            name: '安徽',
            value: 0
        },
        {
            name: '山东',
            value: 0
        },
        {
            name: '新疆',
            value: 752208
        },
        {
            name: '江苏',
            value: 0
        },
        {
            name: '浙江',
            value: 0
        },
        {
            name: '江西',
            value: 0
        },
        {
            name: '湖北',
            value: 0
        },
        {
            name: '广西',
            value: 106360
        },
        {
            name: '甘肃',
            value: 614545
        },
        {
            name: '山西',
            value: 0
        },
        {
            name: '内蒙古',
            value: 0
        },
        {
            name: '陕西',
            value: 0
        },
        {
            name: '吉林',
            value: 0
        },
        {
            name: '福建',
            value: 0
        },
        {
            name: '贵州',
            value: 0
        },
        {
            name: '广东',
            value:
                1807049
        },
        {
            name: '青海',
            value: 0
        },
        {
            name: '西藏',
            value: 0
        },
        {
            name: '四川',
            value: 0
        },
        {
            name: '宁夏',
            value: 0
        },
        {
            name: '海南',
            value: 0
        },
        {
            name: '台湾',
            value: 0
        },
        {
            name: '香港',
            value: 0
        },
        {
            name: '澳门',
            value: 0
        }
    ];
    option = {
        tooltip: {
            triggerOn: "click",
            formatter: function(e, t, n) {
                return .5 == e.value ? e.name + "：有疑似病例" : e.seriesName + "<br />" + e.name + "：" + e.value
            }
        },
        visualMap: {
            min: 0,
            max: 1000,
            left: 26,
            bottom: 40,
            showLabel: !0,
            text: ["高", "低"],
            pieces: [{
                gt: 100,
                label: "异常多",
                color: "rgba(255,0,0)"
            }, {
                gte: 10,
                lte: 1000000,
                label: "较多",
                color: "#ff5428"
            }, {
                gte: 1,
                lt: 750000,
                label: "多",
                color: "#ff8c71"
            }, {
                gt: 0,
                lt: 500000,
                label: "较少",
                color: "#ffd768"
            }, {
                value: 0,
                label:"少",
                color: "rgba(153,255,0)"
            }],
            show: !0
        },
        geo: {
            map: "china",
            roam: !1,
            scaleLimit: {
                min: 1,
                max: 2
            },
            zoom: 1.2,
            top: 50,
            label: {
                normal: {
                    show: !0,
                    fontSize: "14",
                    fontWeight:'bold',
                    // color: "rgba(13,90,177)"
                    color: "rgba(255,255,255,.9)"
                }
            },
            itemStyle: {
                normal: {
                    //shadowBlur: 50,
                    //shadowColor: 'rgba(0, 0, 0, 0.2)',
                    borderColor: "rgba(0, 0, 0, 0.2)"
                },
                emphasis: {
                    areaColor: "#f2d5ad",
                    shadowOffsetX: 0,
                    shadowOffsetY: 0,
                    borderWidth: 0
                }
            }
        },
        series: [{
            name: "申报量",
            type: "map",
            geoIndex: 0,
            data: window.dataList
        }]
    };

    myChart.setOption(option)
    window.onresize = () => {
        //  根据窗口大小调整曲线大小
        myChart.resize();
    };

})();

//区域服务效率
(function () {
    var myChart = echarts.init($(".efficiency1")[0]);

    option = {
        backgroundColor: 'rgba(19, 52, 89, .5)',
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            },
            backgroundColor: 'rgba(9, 24, 48, 0.5)',
            borderColor: 'rgba(75, 253, 238, 0.4)',
            textStyle: {
                color: '#CFE3FC',
            },
            borderWidth: 1,
            formatter: function (params) {
                let str = ''
                for (let i = 0; i < params.length; i++) {
                    if (i == 0) {
                        str += `${params[i].name}<br/>${params[i].seriesName.slice(0, params[i].seriesName.indexOf('('))}<br/><span>${params[0].data}</span>%<br/>`;
                        continue;
                    }
                    str += `${params[i].seriesName.slice(0, params[i].seriesName.indexOf('('))}<br/><span>${params[i].data}</span>个<br/>`
                }
                return "";
            }
        },
        legend: [
            {
                data: ['申报数'],
                top: '25',
                x: '10%',
                itemWidth: 14,
                borderColor: 'rgba(255, 192, 0, 1)',
                textStyle: {
                    color: '#c1cadf',
                    fontSize: 16
                }
            },
            {
                data: ['维修工号种类'],
                top: '25',
                x: '30%',
                itemWidth: 14,
                textStyle: {
                    color: '#c1cadf',
                    fontSize: 16
                }
            },
            {
                data: ['效能'],
                x: '60%',
                top: '25',
                itemStyle: {
                    borderWidth: 2
                },
                textStyle: {
                    color: '#c1cadf',
                    fontSize: 16
                }
            }
        ],
        grid: {
            left: '20px',
            right: '20px',
            top: '50px',
            bottom: '30px',
            containLabel: true
        },
        toolbox: {
            show: true,
            orient: 'vertical',
            x: 'right',
            y: 'center'
        },
        xAxis: [
            {
                type: 'category',
                boundaryGap: true,
                axisTick: {
                    show: false
                },
                data: ['1-1', '2-1', '3-1', '4-1', '5-1', '6-1', '7-1', '8-1'],
                axisLine: {
                    lineStyle: {
                        color: 'rgba(51, 176, 255, 1)'
                    }
                },
                axisLabel: {
                    interval: 0,
                    color: 'rgba(207, 227, 252, 1)',
                    fontSize: 12
                }
            }
        ],
        yAxis: [
            {
                type: 'value',
                axisTick: {
                    show: true
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: 'rgba(120, 160, 236, 1)'
                    },
                    symbol: ['none', 'arrow'],
                    symbolSize: [5, 12],
                    symbolOffset: [0, 10]
                },
                max: 102,
                axisLabel: {
                    interval: 0,
                    color: 'rgba(207, 227, 252, 1)'
                },
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: 'rgba(39, 57, 75, 1)',
                        width: 1,
                        type: 'solid'
                    }
                }
            },
            {
                type: 'value',
                axisTick: {
                    show: true
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: 'rgba(207, 227, 252, 1)t'
                    },
                    symbol: ['none', 'arrow'],
                    symbolSize: [5, 12],
                    symbolOffset: [0, 10]
                },
                min: 0,
                max: 102,
                axisLabel: {
                    interval: 0,
                    color: 'rgba(207, 227, 252, 1)',
                    formatter: '{value} %'
                },
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: 'rgba(39, 57, 75, 1)',
                        width: 1,
                        type: 'solid'
                    }
                }
            }
        ],
        series: [
            {
                type: 'bar',

                yAxisIndex: 0,
                name: '申报数',
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(
                            0,
                            0,
                            0,
                            1,
                            [
                                {
                                    offset: 0,
                                    color: 'rgba(232, 98, 32, 1)'
                                },
                                {
                                    offset: 1,
                                    color: 'rgba(232, 98, 32, 0)'
                                }
                            ],
                            false
                        )
                    }
                },
                barWidth: 18,
                data: [78950 / 683410 * 100, 56622 / 683410 * 100, 90298 / 683410 * 100, 88856 / 683410 * 100, 90527 / 683410 * 100, 89931 / 683410 * 100, 104576 / 683410 * 100, 83650 / 683410 * 100]
            },
            {
                type: 'bar',
                yAxisIndex: 0,
                name: '维修工号种类',
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(
                            0,
                            0,
                            0,
                            1,
                            [
                                {
                                    offset: 0,
                                    color: 'rgba(32, 178, 232, 1)'
                                },
                                {
                                    offset: 1,
                                    color: 'rgba(32, 178, 232, 0)'
                                }
                            ],
                            false
                        )
                    }
                },
                barWidth: 18,
                data: [34, 32, 33, 34, 35, 40, 41, 39]
            },
            {
                name: '效能',
                yAxisIndex: 1,
                type: 'line',
                smooth: true,
                areaStyle: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                        {
                            offset: 0,
                            color: 'rgba(98, 227, 255, 1)'
                        },
                        {
                            offset: 1,
                            color: 'rgba(98, 227, 255, 0)'
                        }
                    ])
                },
                data: [2322.0588 / 18971.4777 * 500, 1769.4375 / 18971.4777 * 500, 2736.303 / 18971.4777 * 500, 2613.4118 / 18971.4777 * 500, 2586.4857 / 18971.4777 * 500, 2248.275 / 18971.4777 * 500, 2550.6341 / 18971.4777 * 500, 2144.8718 / 18971.4777 * 500],
                symbol: 'circle',
                symbolSize: 8,
                itemStyle: {
                    normal: {
                        color: '#FFFFFF',
                        borderColor: 'rgba(0, 255, 240, 1)',
                        lineStyle: {
                            color: 'rgba(0, 255, 240, 1)'
                        }
                    }
                }
            }

        ]
    }
    myChart.setOption(option);
    window.onresize = () => {
        //  根据窗口大小调整曲线大小
        myChart.resize();
    };
})();

//区域服务效能
(function () {
    var myChart = echarts.init($(".efficiency2")[0]);

    option = {
        backgroundColor: '#080b30',
        title: {
            text: '',
            textStyle: {
                align: 'center',
                color: '#fff',
                fontSize: 20,
            },
            top: '5%',
            left: 'center',
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                lineStyle: {
                    color: {
                        type: 'linear',
                        x: 0,
                        y: 0,
                        x2: 0,
                        y2: 1,
                        colorStops: [{
                            offset: 0,
                            color: 'rgba(0, 255, 233,0)'
                        }, {
                            offset: 0.5,
                            color: 'rgba(255, 255, 255,1)',
                        }, {
                            offset: 1,
                            color: 'rgba(0, 255, 233,0)'
                        }],
                        global: false
                    }
                },
            },
        },
        grid: {
            top: '15%',
            left: '5%',
            right: '5%',
            bottom: '15%',
            // containLabel: true
        },
        xAxis: [{
            type: 'category',
            axisLine: {
                show: true
            },
            splitArea: {
                // show: true,
                color: '#f00',
                lineStyle: {
                    color: '#f00'
                },
            },
            axisLabel: {
                color: '#fff'
            },
            splitLine: {
                show: false
            },
            boundaryGap: false,
            data: ['1-1', '2-1', '3-1', '4-1', '5-1', '6-1', '7-1', '8-1'],

        }],

        yAxis: [{
            type: 'value',
            min: 0,
            // max: 140,
            splitNumber: 4,
            splitLine: {
                show: true,
                lineStyle: {
                    color: 'rgba(255,255,255,0.1)'
                }
            },
            axisLine: {
                show: false,
            },
            axisLabel: {
                show: false,
                margin: 20,
                textStyle: {
                    color: '#d1e6eb',

                },
            },
            axisTick: {
                show: false,
            },
        }],
        series: [{
            name: '维修工号种类',
            type: 'line',
            // smooth: true, //是否平滑
            showAllSymbol: true,
            // symbol: 'image://./static/images/guang-circle.png',
            symbol: 'circle',
            symbolSize: 25,
            lineStyle: {
                normal: {
                    color: "#6c50f3",
                    shadowColor: 'rgba(0, 0, 0, .3)',
                    shadowBlur: 0,
                    shadowOffsetY: 5,
                    shadowOffsetX: 5,
                },
            },
            label: {
                show: true,
                position: 'top',
                textStyle: {
                    color: '#6c50f3',
                }
            },
            itemStyle: {
                color: "#6c50f3",
                borderColor: "#fff",
                borderWidth: 3,
                shadowColor: 'rgba(0, 0, 0, .3)',
                shadowBlur: 0,
                shadowOffsetY: 2,
                shadowOffsetX: 2,
            },
            tooltip: {
                show: false
            },
            areaStyle: {
                normal: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0,
                        color: 'rgba(108,80,243,0.3)'
                    },
                        {
                            offset: 1,
                            color: 'rgba(108,80,243,0)'
                        }
                    ], false),
                    shadowColor: 'rgba(108,80,243, 0.9)',
                    shadowBlur: 20
                }
            },
            data: [34, 32, 33, 34, 35, 40, 41, 39],
        },
            {
                name: '效能',
                type: 'line',
                // smooth: true, //是否平滑
                showAllSymbol: true,
                // symbol: 'image://./static/images/guang-circle.png',
                symbol: 'circle',
                symbolSize: 25,
                lineStyle: {
                    normal: {
                        color: "#00ca95",
                        shadowColor: 'rgba(0, 0, 0, .3)',
                        shadowBlur: 0,
                        shadowOffsetY: 5,
                        shadowOffsetX: 5,
                    },
                },
                label: {
                    show: true,
                    position: 'top',
                    textStyle: {
                        color: '#00ca95',
                    }
                },

                itemStyle: {
                    color: "#00ca95",
                    borderColor: "#fff",
                    borderWidth: 3,
                    shadowColor: 'rgba(0, 0, 0, .3)',
                    shadowBlur: 0,
                    shadowOffsetY: 2,
                    shadowOffsetX: 2,
                },
                tooltip: {
                    show: false
                },
                areaStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(0,202,149,0.3)'
                        },
                            {
                                offset: 1,
                                color: 'rgba(0,202,149,0)'
                            }
                        ], false),
                        shadowColor: 'rgba(0,202,149, 0.9)',
                        shadowBlur: 20
                    }
                },

                data: [Math.floor(2322.0588 / 18971.4777 * 500), Math.floor(1769.4375 / 18971.4777 * 500), Math.floor(2736.303 / 18971.4777 * 500), Math.floor(2613.4118 / 18971.4777 * 500), Math.floor(2586.4857 / 18971.4777 * 500), Math.floor(2248.275 / 18971.4777 * 500), Math.floor(2550.6341 / 18971.4777 * 500), Math.floor(2144.8718 / 18971.4777 * 500)],
            },
        ]
    };
    window.onresize = () => {
        //  根据窗口大小调整曲线大小
        myChart.resize();
    };
    myChart.setOption(option);
})();

//云南
(function () {
    var myChart = echarts.init($(".yunnan")[0]);
    option = {
        backgroundColor: '#031245',
        grid: {
            left: '12%',
            top: '5%',
            bottom: '12%',
            right: '8%'
        },
        xAxis: {
            data: ['1-1', '2-1', '3-1', '4-1', '5-1', '6-1', '7-1', '8-1'],
            axisTick: {
                show: false
            },
            axisLine: {
                lineStyle: {
                    color: 'rgba(255, 129, 109,.1)',
                    width: 1 //这里是为了突出显示加上的
                }
            },
            axisLabel: {
                textStyle: {
                    color: '#999',
                    fontSize: 12
                }
            }
        },
        yAxis: [{
            axisTick: {
                show: false
            },
            axisLine: {
                lineStyle: {
                    color: 'rgba(255, 129, 109, 0.1)',
                    width: 1 //这里是为了突出显示加上的
                }
            },
            axisLabel: {
                textStyle: {
                    color: '#999'
                }
            },
            splitArea: {
                areaStyle: {
                    color: 'rgba(255,255,255,.5)'
                }
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: 'rgba(255, 129, 109, 0.1)',
                    width: 0.5,
                    type: 'dashed'
                }
            }
        }
        ],
        series: [{
            type: 'pictorialBar',
            barCategoryGap: '0%',
            symbol: 'path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z',
            label: {
                show: true,
                position: 'top',
                distance: 15,
                color: '#08DFFE',
                fontWeight: 'bolder',
                fontSize: 15,
            },
            itemStyle: {
                normal: {
                    color: {
                        type: 'linear',
                        x: 0,
                        y: 0,
                        x2: 0,
                        y2: 1,
                        colorStops: [{
                            offset: 0,
                            color: '#9A11FF'
                        },
                            {
                                offset: 1,
                                color: '#08DFFE'
                            }
                        ],
                        global: false //  缺省为  false
                    }
                },
                emphasis: {
                    opacity: 1
                }
            },
            data: [34, 32, 33, 34, 35, 40, 41, 39],
        }]
    };
    window.onresize = () => {
        //  根据窗口大小调整曲线大小
        myChart.resize();
    };
    myChart.setOption(option);
})();

//甘肃
(function () {
    var myChart = echarts.init($(".gansu")[0]);

    option = {
        backgroundColor: '#031d33',
        legend: {
            top: "20",
            x: "center",
            textStyle: {
                fontSize: 16,
                color: "rgba(101, 213, 255, 1)"
            },
            icon:
                "path://M512 881.777778 512 881.777778C716.222629 881.777778 881.777778 716.222629 881.777778 512 881.777778 307.777371 716.222629 142.222222 512 142.222222 307.777373 142.222222 142.222222 307.777371 142.222222 512 142.222222 716.222629 307.777373 881.777778 512 881.777778L512 881.777778ZM512 1024 512 1024C229.230208 1024 0 794.769789 0 512 0 229.230211 229.230208 0 512 0 794.769789 0 1024 229.230211 1024 512 1024 794.769789 794.769789 1024 512 1024L512 1024Z",
            itemWidth: 8, // 设置宽度
            itemHeight: 8, // 设置高度、
            itemGap: 12 // 设置间距
        },
        tooltip: {
            show: true,
            trigger: "axis", //axis , item
            backgroundColor: "RGBA(0, 49, 85, 1)",
            borderColor: "rgba(0, 151, 251, 1)",
            borderWidth: 1,
            borderRadius: 0,
            textStyle: {
                color: "#BCE9FC",
                fontSize: 16,
                align: "left"
            }
        },
        grid: {
            right: "5%",
            top: "20%",
            left: "5%",
            bottom: "5%",
            containLabel: true
        },
        xAxis: {
            type: "category",
            boundaryGap: true,
            data: ["1-1", "2-1", '3-1', '4-1', '5-1', '6-1', '7-1', '8-1'],
            axisLabel: {
                //坐标轴刻度标签的相关设置。
                interval: 0, //设置为 1，表示『隔一个标签显示一个标签』
                //	margin:15,
                textStyle: {
                    color: "#65D5FF",
                    fontStyle: "normal",
                    fontSize: 14
                }
            },
            axisTick: {
                //坐标轴刻度相关设置。
                show: false
            },
            axisLine: {
                //坐标轴轴线相关设置
                lineStyle: {
                    color: "rgba(77, 128, 254, 0.2)"
                }
            },
            splitLine: {
                //坐标轴在 grid 区域中的分隔线。
                show: true,
                lineStyle: {
                    color: "rgba(77, 128, 254, 0.2)"
                }
            }
        },
        yAxis: [
            {
                type: "value",
                splitNumber: 3,
                axisLabel: {
                    textStyle: {
                        color: "#65D5FF",
                        fontStyle: "normal",
                        fontSize: 14
                    }
                },
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: "rgba(77, 128, 254, 0.2)"
                    }
                }
            }
        ],
        series: [
            {
                name: '',
                type: "pictorialBar",
                barWidth: "60%",
                stack: "总量",
                label: {
                    normal: {
                        show: false
                    }
                },
                itemStyle: {
                    normal: {
                        color: {
                            type: "linear",
                            x: 0,
                            y: 0,
                            x2: 0,
                            y2: 1,
                            colorStops: [
                                {
                                    offset: 0,
                                    color: "rgba(0, 151, 251, 1)" // 0% 处的颜色
                                },
                                {
                                    offset: 1,
                                    color: "rgba(0, 34, 66, 0.2)" // 100% 处的颜色
                                }
                            ],
                            globalCoord: false // 缺省为 false
                        } //渐变颜色
                    }
                },
                symbol:
                    "path://M12.000,-0.000 C12.000,-0.000 16.074,60.121 22.731,60.121 C26.173,60.121 -3.234,60.121 0.511,60.121 C7.072,60.121 12.000,-0.000 12.000,-0.000 Z",


                data: [49, 43, 33, 34, 39, 38, 38, 43]
            }],
    };
    window.onresize = () => {
        //  根据窗口大小调整曲线大小
        myChart.resize();
    };
    myChart.setOption(option);
})();

//广东
(function () {
    var myChart = echarts.init($(".guangdong")[0]);

    option = {
        backgroundColor: '#031d33',
        animation: true,
        grid: {
            top: "5%",
            bottom: "15%",
            right: "5%"
        },
        xAxis: {
            data: ["1-1", "2-1", '3-1', '4-1', '5-1', '6-1', '7-1', '8-1'],
            axisLine: {
                show: false //隐藏X轴轴线
            },
            axisTick: {
                show: false //隐藏X轴轴线
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: "rgba(77, 128, 254, 0.2)",
                    width: 2
                }
            },
            axisLabel: {
                show: true,
                margin: 10,
                fontSize: 14,
                textStyle: {
                    color: "#65D5FF" //X轴文字颜色
                }
            }
        },
        yAxis: [
            {
                type: "value",
                gridIndex: 0,
                min: 0,
                max: 80,
                interval: 25,
                // splitNumber: 4,
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: "rgba(77, 128, 254, 0.2)",
                        width: 2
                    }
                },
                axisTick: {
                    show: false
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "rgba(77, 128, 254, 0.2)"
                    }
                },
                axisLabel: {
                    show: true,
                    marginRight: 5,
                    fontSize: 14,
                    textStyle: {
                        color: "#65D5FF"
                    }
                }
            }
        ],
        series: [
            {
                name: "设备在线率",
                type: "bar",
                barWidth: 16,
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            {
                                offset: 0,
                                color: "rgba(146, 225, 255, 1)"
                            },
                            {
                                offset: 1,
                                color: "rgba(0, 151, 251, 1)"
                            }
                        ])
                    }
                },
                data: [21, 43, 56, 32, 64],
                z: 10,
                zlevel: 0
            },
            {
                // 分隔
                type: "pictorialBar",
                itemStyle: {
                    normal: {
                        color: "#0F375F"
                    }
                },
                symbolRepeat: "fixed",
                symbolMargin: 6,
                symbol: "rect",
                symbolClip: true,
                symbolSize: [18, 2],
                symbolPosition: "start",
                symbolOffset: [1, 1],
                data: [21, 43, 56, 32, 64],
                width: 2,
                z: 0,
                zlevel: 1
            },
            {
                name: "外框",
                type: "bar",
                barGap: "-110%", // 设置外框粗细
                data: [100, 100, 100, 100, 100, 100, 100],
                barWidth: 16,
                itemStyle: {
                    normal: {
                        color: "transparent", // 填充色
                        // barBorderRadius: 0, //圆角半径
                        label: {
                            // 标签显示位置
                            show: false,
                            position: "top" // insideTop 或者横向的 insideLeft
                        }
                    }
                },
                z: 0
            },
            {
                name: "背影",
                type: "line",
                smooth: true, //平滑曲线显示
                showAllSymbol: false, //显示所有图形。
                symbolSize: 0,
                lineStyle: {
                    width: 0
                },
                areaStyle: {
                    color: "rgba(0, 151, 251, 0.1)"
                },
                data: [104, 259, 600, 303, 188, 239, 270, 113],
                z: 5
            }
        ],
        dataZoom: [
            {
                type: "slider",
                show: false,
                xAxisIndex: [0],
                endValue: 4,
                startValue: 0
            }
        ]
    }
    window.onresize = () => {
        //  根据窗口大小调整曲线大小
        myChart.resize();
    };
    myChart.setOption(option);
})();

//广西
(function () {
    var myChart = echarts.init($(".guangxi")[0]);

    var data1 = [37, 43, 39];
    var data2 = [37, 43, 39];
    var xData = function () {
        var data = [];
        for (var i = 1; i < 13; i++) {
            data.push(i + "月");
        }
        return ['6-1', '7-1', '8-1'];
    }();
    option = {
        backgroundColor: '#020D20',
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow',

                textStyle: {
                    color: '#05294D',
                },
            },
            backgroundColor: '#05294D',
            borderColor: '#135469',
            borderWidth: 2,
            padding: [20, 20, 20, 20],
            formatter: function (params) {
                // console.log(params.length == 0);
                if (params.length === 0) {
                    let result =
                        '<span style="font-size: 24px;font-family: MicrosoftYaHeiUISemibold;color: #FFFFFF;ine-height: 41px;">' +
                        '至少选中一条图例' +
                        '</span>' +
                        '<br>';
                    return result;
                } else if (params.length == 1) {
                    const paramsArray = [];
                    params.forEach((v) => {
                        // console.log(v.name);
                        if (v.seriesName == '趋势') {
                            v.color = '#F3C452';
                        } else {
                            v.color = '#02DBF1';
                        }
                        paramsArray.push({
                            name: v.name,
                            seriesName: v.seriesName,
                            data: v.data,
                            color: v.color,
                        });
                    });
                    // console.log(paramsArray);
                    let result =
                        '<span style="font-size: 24px;font-family: MicrosoftYaHeiUISemibold;color: #FFFFFF;ine-height: 41px;">' +
                        paramsArray[0].name +
                        '</span>' +
                        '<br>';
                    result +=
                        '<div style="display:flex;">' +
                        '<div style="font-size: 20px;font-family: MicrosoftYaHeiUI;color: ' +
                        paramsArray[0].color +
                        ';line-height: 25px;margin-top:10px;margin-right:28px;">' +
                        '旅客' +
                        paramsArray[0].seriesName +
                        '<div style="font-size: 24px;font-family: DINAlternate-Bold, DINAlternate;font-weight: bold;color:' +
                        paramsArray[0].color +
                        ';line-height: 33px;">' +
                        paramsArray[0].data +
                        '人' +
                        '</div>' +
                        '</div>' +
                        '</div>';
                    return result;
                } else {
                    let result =
                        '<span style="font-size: 24px;font-family: MicrosoftYaHeiUISemibold;color: #FFFFFF;ine-height: 41px;">' +
                        params[0].name +
                        '</span>' +
                        '<br>';
                    result +=
                        '<div style="display:flex;">' +
                        '<div style="font-size: 20px;font-family: MicrosoftYaHeiUI;color: #02DBF1;line-height: 25px;margin-top:10px;margin-right:28px;">' +
                        '旅客' +
                        params[0].seriesName +
                        '<div style="font-size: 24px;font-family: DINAlternate-Bold, DINAlternate;font-weight: bold;color: #02DBF1;line-height: 33px;">' +
                        params[0].data +
                        '人' +
                        '</div>' +
                        '</div>' +
                        '<div style="margin-top:10px;font-size: 20px;font-family: MicrosoftYaHeiUI;color: #F3C452;line-height: 25px;">' +
                        '旅客' +
                        params[1].seriesName +
                        '<div style="font-size: 24px;font-family: DINAlternate-Bold, DINAlternate;font-weight: bold;color: #F3C452;line-height: 33px;">' +
                        params[1].data +
                        '人' +
                        '</div>' +
                        '</div>' +
                        '</div>';
                    return result;
                }
            },
        },
        grid: {
            borderWidth: 0,
            top: '20%',
            left: '65',
            bottom: '25%',
            textStyle: {
                color: '#fff',
            },
        },
        legend: {
            top: '0%',
            right: '10%',
            textStyle: {
                fontSize: '20px',
                fontFamily: 'MicrosoftYaHeiUI',
                color: '#FFFFFF',
            },
            itemWidth: 28,
            itemHeight: 28,
            data: [
                {
                    name: '维修工号种类',
                    icon:
                        'image://',
                },
                {
                    name: '维修工号种类',
                    icon:
                        'image://',
                },
            ],
        },
        xAxis: [
            {
                type: 'category',
                axisLine: {
                    lineStyle: {
                        color: 'rgba(255,255,255,.5)',
                    },
                },
                splitLine: {
                    show: false,
                },
                axisTick: {
                    show: false,
                },
                splitArea: {
                    show: false,
                },
                axisLabel: {
                    interval: 0,
                    color: 'rgba(255,255,255,0.7)',
                    fontSize: 14,
                },
                data: xData,
            },
        ],
        yAxis: [
            {
                type: 'value',
                splitLine: {
                    show: false,
                },
                axisLine: {
                    show: false,
                },
                axisTick: {
                    show: false,
                },
                axisLabel: {
                    interval: 0,
                    color: 'rgba(255,255,255,0.5)',
                    fontSize: 14,
                },
                splitArea: {
                    show: false,
                },
            },
        ],
        // yAxis: [
        //   {
        //     type: 'value',
        //     show: false,
        //     name: '',
        //     min: 0,
        //     max: 2400,
        //     position: 'right',
        //     axisLine: {
        //       lineStyle: {
        //         color: 'rgba(2, 13, 32, 1)'
        //       }
        //     },
        //     axisLabel: {
        //       formatter: '{value}'
        //     }
        //   },
        //   {
        //     type: 'value',
        //     name: '周转量',
        //     show: false,
        //     min: 0,
        //     max: 2400,
        //     position: 'right',
        //     offset: 80,
        //     axisLine: {
        //       lineStyle: {
        //         color: 'rgba(2, 13, 32, 1)'
        //       }
        //     },
        //     axisLabel: {
        //       formatter: '{value}'
        //     }
        //   },
        //   {
        //     type: 'value',
        //     // name: '单位：人公里',
        //     min: 0,
        //     max: 2400,
        //     position: 'left',
        //     axisLine: {
        //       lineStyle: {
        //         color: '#fff'
        //       }
        //     },
        //     axisLabel: {
        //       formatter: '{value}'
        //     }
        //   }
        // ],
        series: [
            {
                name: '维修工号种类',
                type: 'bar',
                // "stack": "总量",
                barMaxWidth: 35,
                barGap: '10%',
                itemStyle: {
                    normal: {
                        color: {
                            type: 'linear',
                            x: 0,
                            y: 0,
                            x2: 0,
                            y2: 1,
                            colorStops: [
                                {
                                    offset: 0,
                                    color: '#05F5FF', // 0% 处的颜色
                                },
                                {
                                    offset: 1,
                                    color: '#020D20', // 100% 处的颜色
                                },
                            ],
                            global: false, // 缺省为 false
                        },
                    },
                },
                data: data1,
            },
            {
                name: '维修工号种类',
                type: 'line',
                symbolSize: 10,
                symbol: 'circle',
                itemStyle: {
                    normal: {
                        color: 'rgba(255, 196, 53, 1)',
                        barBorderRadius: 0,
                    },
                },
                lineStyle: {
                    normal: {
                        width: 4,
                        color: {
                            type: 'linear',
                            x: 0,
                            y: 0,
                            x2: 0,
                            y2: 1,
                            colorStops: [
                                {
                                    offset: 0,
                                    color: '#F0B62A', // 0% 处的颜色
                                },
                                {
                                    offset: 0.45,
                                    color: '#FFC12B', // 45% 处的颜色
                                },
                                {
                                    offset: 0.85,
                                    color: '#FFC12B', // 85% 处的颜色
                                },
                                {
                                    offset: 1,
                                    color: '#FFC12B', // 100% 处的颜色
                                },
                            ],
                            global: false, // 缺省为 false
                        },
                    },
                },
                data: data2,
            },
        ],
    };
    window.onresize = () => {
        //  根据窗口大小调整曲线大小
        myChart.resize();
    };
    myChart.setOption(option);
})();

//新疆
(function () {
    var myChart = echarts.init($(".xinjiang")[0]);

    option = {
        backgroundColor: '#011c3a',
        legend: {
            show: true,
            textStyle: {
                color: '#fff'
            },
            data: [{
                name: '维修工号种类',
                icon: 'rect'
            }, {
                name: '维修工号种类'
            }]
        },
        tooltip: {
            show: true,
        },
        xAxis: {
            data: ["1-1", "2-1", '3-1', '4-1', '5-1', '6-1', '7-1', '8-1'],
            axisLine: {
                lineStyle: {
                    color: '#3d5269'
                }
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                color: '#fff',
                fontSize: 14
            }
        },
        yAxis: [{
            type: 'value',
            name: "单位:种",
            nameTextStyle: {
                color: '#fff',
                fontSize: 14
            },
            axisLine: {
                show: false,
                lineStyle: {
                    color: '#3d5269'
                }
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                color: '#fff',
                fontSize: 14
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: '#2d3d53'
                }
            },
            max: 2,
            interval: 1200,
            yAxisIndex: 0

        }, {
            type: 'value',
            name: "(种)",
            nameTextStyle: {
                color: '#fff',
                fontSize: 14
            },
            max: 2,
            axisLine: {
                show: false,
                lineStyle: {
                    color: '#3d5269'
                }
            },
            axisLabel: {
                show: true,
                color: '#fff',
                fontSize: 12
            },

            splitLine: {
                show: true,
                lineStyle: {
                    color: '#2d3d53'
                }
            },
            interval: 1200,

        }],
        series: [
            {
                name: '维修工号种类',
                type: 'bar',
                barWidth: 20,
                zlevel: 2,
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: '#05af79'
                        }, {
                            offset: 1,
                            color: '#05af792e'
                        }], false)
                    }
                },
                label: {
                    normal: {
                        show: false,
                        fontSize: 18,
                        fontWeight: 'bold',
                        color: '#ffffff',
                        position: 'top',
                    }
                },

                data: [1, 1, 1, 1, 1, 1, 1, 1]
            }, {
                name: '用电量',
                type: 'line',
                smooth: true, //是否平滑
                showAllSymbol: true,
                symbol: 'circle',
                yAxisIndex: 1,
                symbolSize: 6,
                lineStyle: {
                    normal: {
                        color: "rgba(0, 96, 255, 1)",
                    },
                },
                zlevel: 1,
                label: {
                    show: false,
                    position: 'top',
                    textStyle: {
                        color: '#6c50f3',
                    }
                },
                itemStyle: {
                    color: "rgba(0, 96, 255, 0.8)",
                    borderColor: "#fff",
                    borderWidth: 2,
                },
                areaStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(0, 96, 255, 0.6)'
                        },
                            {
                                offset: 1,
                                color: 'rgba(0, 96, 255, 0)'
                            }
                        ], false),
                        shadowColor: 'rgba(0, 96, 255, 0.9)',
                        shadowBlur: 10
                    }
                },
                data:  [1, 1, 1, 1, 1, 1, 1, 1]
            }]
    };
    window.onresize = () => {
        //  根据窗口大小调整曲线大小
        myChart.resize();
    };
    myChart.setOption(option);
})();
